Skip to content

Initial setup add changesets, versioning commented out github action - #7

Merged
PawanP1808 merged 6 commits into
mainfrom
prepare-for-publishing
Jun 4, 2026
Merged

Initial setup add changesets, versioning commented out github action#7
PawanP1808 merged 6 commits into
mainfrom
prepare-for-publishing

Conversation

@PawanP1808

@PawanP1808 PawanP1808 commented Jun 2, 2026

Copy link
Copy Markdown
Collaborator

Summary

Prepares @shopify/shop-cli to be published publicly to npm and restructures the repository to match the layout/conventions of Shopify/ucp-cli. No runtime behavior of the CLI changes for end users beyond a small hardening fix to image URL rendering and the version now being sourced from package.json.

This is setup-only groundwork: the release workflow is included but intentionally disabled (commented out) so nothing publishes until we deliberately enable it.

What changed

Repo restructure to match ucp-cli

  • Moved the package from package/ to the repository root (src/, tests/, tsconfig*.json, package.json, pnpm-lock.yaml).
  • Removed the nested package/ directory and its duplicate lockfile.

npm publishing setup

  • package.json: set license: MIT, added repository, bugs, homepage, sideEffects: false, exports, publishConfig.access: public, files (dist, README.md, LICENSE, src), and pnpm.onlyBuiltDependencies: ["keytar"].
  • Added Changesets (.changeset/config.json, .changeset/README.md) with changeset / version-packages / release scripts.
  • Added .npmrc (matching ucp-cli: minimum-release-age, package-manager-strict, peer-dep settings).
  • Added LICENSE (MIT, copied from Shopify/ucp-cli).
  • Added README.md oriented at public install/usage.
  • Added .github/workflows/release.yml — a ucp-cli-style Changesets + npm OIDC (Trusted Publishing) release workflow. Committed commented-out so it is inert until we enable publishing.

CLI / source changes

  • src/cli.ts: --version now reads from package.json via createRequire instead of a hardcoded string, so the CLI version always matches the published package. Test script copies package.json into the test build to support this.
  • src/render.ts: image URLs from (untrusted) merchant catalog content are now filtered to HTTPS only before being rendered as Img:. http:, file:, data:, javascript:, and malformed URLs are skipped, falling through to the next safe media URL (enforces the rule in references/safety.md).

Docs

  • SKILL.md: fixed install/uninstall instructions for the new root layout (removed cd package), corrected the uninstall package name (@shopify/shop@shopify/shop-cli), aligned frontmatter version to 0.1.0, removed an empty section.

Tests

  • Added render.test.ts cases covering HTTPS image rendering, rejection of non-HTTPS schemes with fall-through, and omission of Img: when no media URL is HTTPS.

Why

We want to distribute the Shop CLI as a public npm package while keeping a clean, conventional repo that mirrors ucp-cli, so release tooling and contributor experience are consistent across our CLIs. Sourcing the version from package.json and adding Changesets makes releases reproducible. The image-URL hardening closes a gap between references/safety.md (which requires HTTPS-only image URLs) and the actual render code.

Testing

  • pnpm typecheck — passes
  • pnpm test — 62/62 pass (3 new render tests)
  • pnpm build — passes
  • pnpm pack:dry — verified tarball contents (dist, src, README.md, LICENSE, package.json); no source maps, no secrets

What could go wrong?

  • Release workflow: it ships disabled, so it cannot publish yet. When enabled, npm OIDC Trusted Publishing must be configured against the final repo (Shopify/shop-cli) and workflow filename, and the first @shopify/shop-cli publish must be bootstrapped via AI Ops (#help-eng-infrastructure). Enabling without that setup will fail the publish step (not a silent/bad publish).
  • Version-from-package.json: relies on src being shipped relative to package.json (files includes both); createRequire('../package.json') resolves correctly from dist/. Covered by the existing CLI version test.
  • Image filtering: products whose only media URL is non-HTTPS will render without an Img: line. This is intended (security) but is a visible behavior change for any such listings.
  • Repo restructure: any external tooling or docs referencing the old package/ path will need updating.

Follow-ups (not in this PR)

  • Move repo to the Shopify org and enable the release workflow.
  • Confirm CLIENT_ID is a registered public OAuth client (no secret) before publishing.

@shopify-bumperbot

shopify-bumperbot Bot commented Jun 2, 2026

Copy link
Copy Markdown

🔍 Denylist Analysis Results

Discovered 100 packages. These include both those that are net-new and those that have been explicitly approved or denied for use.

pnpm-lock.yaml


🔄 New Packages Entering the Supply Chain (2)
Package Version Details
is-extglob 2.1.1 Package is pending analysis
run-parallel 1.2.0 Package is pending analysis
Known Packages - Approved for Use (98)
Package Version Details
@babel/runtime 7.29.7 Package policy allows this version
@changesets/apply-release-plan 7.1.1 Package policy allows this version
@changesets/assemble-release-plan 6.0.10 Package policy allows this version
@changesets/changelog-git 0.2.1 Package policy allows this version
@changesets/cli 2.31.0 Package policy allows this version
@changesets/config 3.1.4 Package policy allows this version
@changesets/errors 0.2.0 Package policy allows this version
@changesets/get-dependents-graph 2.1.4 Package policy allows this version
@changesets/get-release-plan 4.0.16 Package policy allows this version
@changesets/get-version-range-type 0.4.0 Package policy allows this version
@changesets/git 3.0.4 Package policy allows this version
@changesets/logger 0.1.1 Package policy allows this version
@changesets/parse 0.4.3 Package policy allows this version
@changesets/pre 2.0.2 Package policy allows this version
@changesets/read 0.6.7 Package policy allows this version
@changesets/should-skip-package 0.1.2 Package policy allows this version
@changesets/types 4.1.0 Package policy allows this version
@changesets/types 6.1.0 Package policy allows this version
@changesets/write 0.4.0 Package policy allows this version
@inquirer/external-editor 1.0.3 Package policy allows this version
@manypkg/find-root 1.1.0 Package policy allows this version
@manypkg/get-packages 1.1.3 Package policy allows this version
@nodelib/fs.scandir 2.1.5 Package policy allows this version
@nodelib/fs.stat 2.0.5 Package policy allows this version
@nodelib/fs.walk 1.2.8 Package policy allows this version
@types/node 12.20.55 Package policy allows this version
@types/node 22.19.19 Package policy allows this version
ansi-colors 4.1.3 Package policy allows this version
ansi-regex 5.0.1 Package policy allows this version
argparse 1.0.10 Package policy allows this version
argparse 2.0.1 Package policy allows this version
array-union 2.1.0 Package policy allows this version
better-path-resolve 1.0.0 Package policy allows this version
braces 3.0.3 Package policy allows this version
chardet 2.1.1 Package policy allows this version
cross-spawn 7.0.6 Package policy allows this version
detect-indent 6.1.0 Package policy allows this version
dir-glob 3.0.1 Package policy allows this version
enquirer 2.4.1 Package policy allows this version
esprima 4.0.1 Package policy allows this version
extendable-error 0.1.7 Package policy allows this version
fast-glob 3.3.3 Package policy allows this version
fastq 1.20.1 Package policy allows this version
fill-range 7.1.1 Package policy allows this version
find-up 4.1.0 Package policy allows this version
fs-extra 7.0.1 Package policy allows this version
fs-extra 8.1.0 Package policy allows this version
glob-parent 5.1.2 Package policy allows this version
globby 11.1.0 Package policy allows this version
graceful-fs 4.2.11 Package policy allows this version
human-id 4.1.3 Package policy allows this version
iconv-lite 0.7.2 Package policy allows this version
ignore 5.3.2 Package policy allows this version
is-glob 4.0.3 Package policy allows this version
is-number 7.0.0 Package policy allows this version
is-subdir 1.2.0 Package policy allows this version
is-windows 1.0.2 Package policy allows this version
isexe 2.0.0 Package policy allows this version
js-yaml 3.14.2 Package policy allows this version
js-yaml 4.1.1 Package policy allows this version
jsonfile 4.0.0 Package policy allows this version
locate-path 5.0.0 Package policy allows this version
lodash.startcase 4.4.0 Package policy allows this version
merge2 1.4.1 Package policy allows this version
micromatch 4.0.8 Package policy allows this version
mri 1.2.0 Package policy allows this version
outdent 0.5.0 Package policy allows this version
p-filter 2.1.0 Package policy allows this version
p-limit 2.3.0 Package policy allows this version
p-locate 4.1.0 Package policy allows this version
p-map 2.1.0 Package policy allows this version
p-try 2.2.0 Package policy allows this version
package-manager-detector 0.2.11 Package policy allows this version
path-exists 4.0.0 Package policy allows this version
path-key 3.1.1 Package policy allows this version
path-type 4.0.0 Package policy allows this version
picocolors 1.1.1 Package policy allows this version
picomatch 2.3.2 Package policy allows this version
pify 4.0.1 Package policy allows this version
prettier 2.8.8 Package policy allows this version
quansync 0.2.11 Package policy allows this version
queue-microtask 1.2.3 Package policy allows this version
read-yaml-file 1.1.0 Package policy allows this version
resolve-from 5.0.0 Package policy allows this version
reusify 1.1.0 Package policy allows this version
safer-buffer 2.1.2 Package policy allows this version
shebang-command 2.0.0 Package policy allows this version
shebang-regex 3.0.0 Package policy allows this version
signal-exit 4.1.0 Package policy allows this version
slash 3.0.0 Package policy allows this version
spawndamnit 3.0.1 Package policy allows this version
sprintf-js 1.0.3 Package policy allows this version
strip-ansi 6.0.1 Package policy allows this version
strip-bom 3.0.0 Package policy allows this version
term-size 2.2.1 Package policy allows this version
to-regex-range 5.0.1 Package policy allows this version
universalify 0.1.2 Package policy allows this version
which 2.0.2 Package policy allows this version

For any questions or to provide feedback, please reach out to #help-bumperbot.

Generated by Bumperbot.

Comment thread package/LICENSE.md Outdated
@@ -0,0 +1,8 @@
Copyright Shopify Inc. All rights reserved.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@joerj123 This is AI generated will need your/legal review. Flagging so we can get ahead of it.

@PawanP1808
PawanP1808 marked this pull request as ready for review June 3, 2026 18:10
@@ -0,0 +1,48 @@
# name: Release

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Commented out until we are ready to publish it.

@PawanP1808
PawanP1808 requested a review from jacobrydh June 4, 2026 17:25
@PawanP1808
PawanP1808 merged commit d94207b into main Jun 4, 2026
2 checks passed
@PawanP1808
PawanP1808 deleted the prepare-for-publishing branch June 11, 2026 12:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants